<?php
defined('OA_LIB_PATH') || define('OA_LIB_PATH', '/opt/op/OALib');

require_once 'PHPUnit/Framework.php';
require_once 'Log.php';
require_once OA_LIB_PATH . '/inner/open/models/OaGsOrderLogModel.php';

class OaGsOrderLogModelTest extends PHPUnit_Framework_TestCase
{
    private $_logger;
    private $_model;
    
    protected function setUp()
    {
        $logger = Log::factory('console');
        $logger->setMask(Log::MAX(PEAR_LOG_DEBUG));
        $this->_logger = $logger;
        $this->_model = new OaGsOrderLogModel($logger);
    }
    
    protected function tearDown()
    {
        
    }
    
    public function testGetRegLoginDataByArea()
    {
        //$this->markTestSkipped();
        $result = $this->_model->getServiceInfo('2010-04-01', '2010-04-26');
        $this->_logger->log($result, PEAR_LOG_DEBUG);
        $this->assertTrue(is_array($result));
        $result = $this->_model->getLogList(1, '2010-04-01', '2010-04-26', 51029, 0, 5);
        $this->_logger->log($result, PEAR_LOG_DEBUG);
        $this->assertTrue(is_array($result));
//        $result = $this->_model->getLogList(1, '2010-04-01', '2010-04-26', 51029, 0, 5, 'bixiaochao0331', 1, '22222010041214582099585495659752');
//        $this->_logger->log($result, PEAR_LOG_DEBUG);
//        $this->assertTrue(is_array($result));
//        $result = $this->_model->getLogCount(1, '2010-04-01', '2010-04-26', 51029);
//        $this->_logger->log($result, PEAR_LOG_DEBUG);
//        $this->assertTrue($result !== false);
    }
    public function testGetLogInfo()
    {
//        $this->markTestSkipped();
        $result = $this->_model->getLogInfo(1, '22222010041214582046668190634314', 51029);
        $this->_logger->log($result, PEAR_LOG_DEBUG);
        $this->assertTrue(is_array($result));          
    }
}